#include<stdio.h>
#include<string.h>


/*
      函数：三要素
          1.函数名 见名知义
          2.函数参数 括号内 (形参)
          3.函数返回值      (int,float,double,bool,char,void)
*/
 
 /*函数的定义*/
 int add(int num1,int num2)
 {
    int sum = 0;
    sum = num1 +num2;
    return sum;
 }
 /*函数实现*/
void printSunday(int num)
{
   printf("today is sunday... class has %d persons\n",num);
}
int main()
{      
   #if 0
       /*函数的调用*/
       int a = 10,b = 666;
       swapNum(&a,&b);
       printf("num1:%d,num2=%d\n",a,b);

       int num = 19;
       printfSunday(&bal);
       printf("num:%d\n",val)
       #endif
}
void printName(char *str)
{
   int size = sizeof(str);
    /*指针的内存大小都是8*/

    int length = strlen(str);
    printf("fun ------  size:%d\n",size);
    printf("fun ------  length:%d\n",length);

    printf("str:%s\n",str);
}
 int main()
 {
    /*函数的调用*/
    int sum = add(3,100);

    printf("sum:%d\n",sum);

    return 0;
    /*函数的调用*/
    int val = 19;
    printfSunday(&val);
    printf("num:%d\n",val);

    char name[20] = "zhangsanandlisi";
    #if 0
    int size = sizeof(name);
    int length = strlen(name);
    printf("size:%d\n",size);
    printf("length:%d\n",length);
    #endif
    
    scanf("%s",name);
    printf("name:%s\n",name);
#if 0
    /*数组名就是数组的首地址*/
   printf("name:%p\n,name");
   printf("&name[0]:%p\n,&name[0]");
   

    char alphabet = '0';
    scanf("%c",&alphabet);
    printf("alphabet:%c\n",alphabet);
#endif
    printName(name);

    int * p = &num;
    char *ptr = "fergr";

    /*指针的内存大小都是8*/
    return 0;
 }